package com.greensam.pixelengine.pojo.emuns;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 角色枚举
 *
 * @author Macro_Ray
 * @since 2025/6/17 11:03
 */
@Getter
@AllArgsConstructor
public enum TeamSpaceRoleEnum {

    VIEWER("团队浏览者", "viewer","团队空间中的浏览者"),

    EDITOR("团队编辑者", "editor","团队空间中的编辑者"),

    SUPERVISOR("团队管理员", "supervisor","团队空间中的管理员"),

    ;

    private final String name;

    private final String code;

    private final String description;


    /**
     * 根据 code 获取枚举
     */
    public static TeamSpaceRoleEnum getEnumByCode(String  code) {
        for (TeamSpaceRoleEnum teamSpaceRoleEnum : TeamSpaceRoleEnum.values()) {
            if (teamSpaceRoleEnum.code.equals(code)) {
                return teamSpaceRoleEnum;
            }
        }
        return null;
    }


}
